home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Container Common / CArgumentParser.h < prev    next >
Text File  |  1997-01-03  |  958b  |  42 lines

  1. // ===========================================================================
  2. //    CArgumentParser.h               ©1996 Microsoft Corporation. All rights reserved.
  3. // ===========================================================================
  4.  
  5.  
  6. typedef enum
  7. {
  8.     Alpha = 0, Numeric, WhiteSpace, Assignment, Quote, Unknown, EOF, CharTypeCount
  9. }
  10. chartype;
  11.  
  12. typedef enum
  13. {
  14.     AddToBuffer = 0, TermArgName, TermArgValue, None, Error
  15. }
  16. parseraction;
  17.  
  18. typedef enum
  19. {
  20.     WaitArgName = 0, BuildArgName, WaitAssign, WaitArgValue, BuildArgVal, BuildArgValLit, Undefined,
  21.     StateCount, Stop = WaitArgName
  22. }
  23. parserstate;
  24.  
  25. class CArgumentParser
  26. {
  27. public:
  28.                     CArgumentParser(void);
  29.                     ~CArgumentParser(void);
  30.  
  31.     void            Reset(void);
  32.     Boolean            ProcessChar(char c);
  33.     Boolean            GetArguments(Ptr *ArgBuffer, char **ArgNames[], char **ArgValues[], short *ArgCount);
  34.  
  35. protected:
  36.  
  37. private:
  38.     Handle            Buffer;
  39.     char            InputBuffer[256];
  40.     Uint16            InputBufferCount;
  41.     parserstate        CurrentState;
  42. };